package ningbo.day05.array;

import java.time.DayOfWeek;
import java.util.Arrays;
import java.util.Random;

/**
 * @Author 宁铂
 * @Date 2021/7/18 10:57
 * @Version 1.0
 */
public class TestArrayExec {
    /** 输出每个月的天数、创建随机数组 */

    public static void main(String[] args) {
        day();

        /** 存随机数 */
        day01();
    }

    private static void day01() {
        int[] a = new int[10];
        Random random = new Random(47);

        for(int i = 0; i<=a.length-1; i++){
            a[i] = random.nextInt(100);

        }
        System.out.println(Arrays.toString(a));
    }

    private static void day() {
        int[] a = new int[]{31,28,31,30,31,30,31,31,30,31,30,31};

        for (int i = 0; i <=a.length-1; i++){
            System.out.println((i+1)+"月有"+a[i]+"天");
        }
    }
}
